PEN Function ---------------------------------------------------------------------------- Action Returns lightpen status. Syntax PEN( n%) Remarks The argument n% is an integer value between 0 and 9, inclusive, that specifies what information is to be returned about the status of the lightpen. Note The PEN function does not work when the mouse driver is enabled because the mouse driver uses the PEN function's BIOS calls. Use mouse function 14 to disable the driver's lightpen emulation. Mouse function 13 turns emulation back on. See your mouse manual for more information. The following list describes the values for n% and the corresponding values returned by PEN. ----------------------------------------------------------------------------- Argument Value returned ---------------------------------------------------------------------------- 0 Whether the pen was down since the last function call (-1 if yes, 0 if no). 1 The x coordinate of the last pen press. 2 The y coordinate of the last pen press. 3 The current pen switch status (-1 if down, 0 if up). 4 The x coordinate where the pen last left the screen. Argument Value returned ---------------------------------------------------------------------------- 5 The y coordinate where the pen last left the screen. 6 The character row of the last pen press. 7 The character column of the last pen press. 8 The character row where the pen last left the screen. 9 The character column where the pen last left the screen.- The light-pen coordinate system is identical to the current graphics screen mode, without viewport or window considerations. Note The PEN function is not available in OS-2 protected mode. See Also